<html>
<head><meta charset="utf-8"><title>regions and generators #64552 · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/regions.20and.20generators.20.2364552.html">regions and generators #64552</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="177638568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/regions%20and%20generators%20%2364552/near/177638568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/regions.20and.20generators.20.2364552.html#177638568">(Oct 08 2019 at 17:26)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="125294">@Aaron Hill</span> -- let's discuss <a href="https://github.com/rust-lang/rust/issues/64552" target="_blank" title="https://github.com/rust-lang/rust/issues/64552">https://github.com/rust-lang/rust/issues/64552</a> a bit! (Putting this msg here so I don't forget)</p>
<p>Maybe we can sched a time to sync up?</p>



<a name="179093389"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/regions%20and%20generators%20%2364552/near/179093389" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/regions.20and.20generators.20.2364552.html#179093389">(Oct 25 2019 at 22:10)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Sorry, I really should check Zulip more frequently - I just saw your message</p>



<a name="179094288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/regions%20and%20generators%20%2364552/near/179094288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/regions.20and.20generators.20.2364552.html#179094288">(Oct 25 2019 at 22:24)</a>:</h4>
<p>I've taken a look at this recently. The main issue I ran into was how to extract the relevant information from the InferCtxt. We obviously don't want to have a <code>GeneratorWitness</code> carry around the entire <code>InferCtxt</code> from its parent function. I think we need to:</p>
<ol>
<li>Determine which region constraints are 'relevant' (from <code>RegionConstraintCollector</code>).</li>
<li>Extract them from the <code>InferCtxt</code>, and re-write them to use the late-bound variables used by the witness type.</li>
<li>When <code>SelectionContext</code> processes a <code>GeneratorWitness </code>predicate, create fresh inference variables in the <code>SelectionContext</code>'s <code>InferCtxt</code>, and apply the stored constraints the new inference variables.</li>
</ol>
<p>However, I've not that familiar with how region inference works, so I might be missing something.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>